//
//  LPTabBar.m
//  彩票
//
//  Created by liupan on 2016/11/29.
//  Copyright © 2016年 liupan. All rights reserved.
//

#import "LPTabBar.h"

@implementation LPTabBar

- (instancetype)initWithFrame:(CGRect)frame{

    if (self=[super initWithFrame:frame]) {
        
    }
    return self;
}

- (void)layoutSubviews{

    [super layoutSubviews];
    //设置按钮的尺寸
    NSInteger index = 0;
    for (UIView *button in self.subviews) {
        if ([button isKindOfClass:NSClassFromString(@"UITabBarButton")]) {
            CGFloat btnW = [UIScreen mainScreen].bounds.size.width / 5;
            CGFloat btnH = self.bounds.size.height;
            CGFloat btnX = btnW * index;
            button.frame=CGRectMake(btnX, 0, btnW, btnH);
            index++;
        }
    }
}
@end
